import Vue from 'vue'
import VueRouter from 'vue-router'
// Home路由 首页
import HomeRouter from '@/views/APP/router'
// Login路由 登录
import LoginRouter from '@/views/Login/router'
// ErrPage路由 错误
import ErrPageRouter from '@/views/ErrPage/router'
// Order路由 订单
import OrderRouter from '@/views/Order/router'
// Address路由 地址
import AddressRouter from '@/views/Address/router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: {name: "home"}
  },
  ...HomeRouter,
  ...LoginRouter,
  ...OrderRouter,
  ...ErrPageRouter,
  ...AddressRouter,
  {
    path: '*',
    redirect: {name: '404'}
  }
]

const router = new VueRouter({
  mode: 'hash',
  base: '',
  routes
})

export default router
